package afeng.run.jenkinsdemodeploy.controller;

import afeng.run.jenkinsdemodeploy.model.User;
import afeng.run.jenkinsdemodeploy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserOption {

    @Autowired
    UserService userService;

    @RequestMapping("/selectByUserId")
    public User selectByUserId(Integer id){
        id=1;
        return userService.selectUserById(id);
    }

    @RequestMapping("/updateUser")
    public int updateUser(User user){
//        user.setPassword("222");
//        user.setUserName("你好");
//        user.setAge(110);
//        user.setId(1);

        return userService.updateUser(user);
    }

    @RequestMapping("/getRedisUser")
    public String getRedisUser(){
        return userService.getUser();
    }

}
